#include "userinfo.h"

UserInfo::UserInfo()
{
    m_id.clear();
    m_name.clear();
    m_pswd.clear();
    m_tel.clear();
    m_head.clear();
}

UserInfo::UserInfo(const QString &id, const QString &name, const QString &pswd, const QString &tel, const QString &head)
{
    m_id = id;
    m_name = name;
    m_pswd = pswd;
    m_tel = tel;
    m_head = head;
}

void UserInfo::display() const
{
    qDebug() << "ID:" << m_id;
    qDebug() << "Name:" << m_name;
    qDebug() << "Pswd:" << m_pswd;
    qDebug() << "Tel:" << m_tel;
    qDebug() << "Head:" << m_head;
}

void UserInfo::setID(const QString &id)
{
    m_id = id;
}

void UserInfo::setName(const QString &name)
{
    m_name = name;
}

void UserInfo::setPswd(const QString &pswd)
{
    m_pswd = pswd;
}

void UserInfo::setTel(const QString &tel)
{
    m_tel = tel;
}

void UserInfo::setHead(const QString &head)
{
    m_head = head;
}

const QString &UserInfo::getID() const
{
    return m_id;
}

const QString &UserInfo::getName() const
{
    return m_name;
}

const QString &UserInfo::getPswd() const
{
    return m_pswd;
}

const QString &UserInfo::getTel() const
{
    return m_tel;
}

const QString &UserInfo::getHead() const
{
    return m_head;
}

void UserInfo::updateInfo(const QString &id, const QString &name, const QString &pswd, const QString &tel, const QString &head)
{
    m_id = id;
    m_name = name;
    m_pswd = pswd;
    m_tel = tel;
    m_head = head;
}

bool operator ==(const UserInfo &user, const UserInfo &user2)
{
    return user.m_id == user2.m_id;
}
